import eventManager


class MyMsg(object):
    """
    * 在eventManager中制造事件
    * 调用时需要将 eventManager 对象传入
    """
    def __init__(self, eventManager):
        self.__eventManager = eventManager

    def makeMsg(self,key,value):
        """
        事件对象：制造事件
        将事件写入event 并send
        """
        event = eventManager.Event( type_ = eventManager.EVENT_MSG)
        event.dict[key] = value

        # 发送事件
        self.__eventManager.SendEvent(event)